<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>资源 - FNK</title>
        <link rel="stylesheet" href="/static/css/navbar.css">
        <link rel="stylesheet" href="/static/css/page.css">
    </head>
    <body>
        <nav class="navbar">
            <div class="logo">FNK</div>
            <ul class="nav-links">
                <li><a href="/home">首页</a></li>
                <li><a href="/file">文件</a></li>
                <li><a href="/note">笔记</a></li>
                <li><a href="/resource">资源</a></li>
                <li><a href="/about">关于</a></li>
            </ul>
            <div class="users">
            {% if user %}
                <p>{{ user }}</p>
                <button class="user-btn" onclick="javascript:location.href='/logout'">登出</button>
            {% else %}
                <button class="user-btn" onclick="javascript:location.href='/login'">登录</button>
            {% endif %}
            </div>
        </nav>
        <div class="page-box">
            <h1 class="title">资源</h1><hr>
            {% if user=='root' %}
                <form action="/resource" method="POST" enctype="multipart/form-data">
                    <input class="btn" type="file" name="file">
                    <input class="btn" type="submit">
                </form>
            {% endif %}
            {% for file in files %}
                <a href="/resource/{{ file }}">{{ file }}</a><br>
            {% endfor %}
        </div>
    </body>
</html>